<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page isELIgnored="false" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html style="overflow-y: visible;">
    <jsp:include page="../../../include/IncludeMain.jsp"></jsp:include>
  <body style="overflow-y: visible!important;overflow-y: scroll;">
	  <form action="${pageContext.request.contextPath }/pages/order/orderListAction!save" name="myForm" id="myForm" method="post">
	    	<table class="mainTable">
				<thead>
					<tr class="tableController">
						<th colspan="2">
							<h3>订单编辑</h3>
						</th>
					</tr>
					<tr>
						<th>&nbsp;	</th>
						<th class="errorTip" style='<c:if test="${empty message}">display:none</c:if>'>
							<c:forEach items="${message}" var="m">
								${m }
							</c:forEach>
						</th>
					</tr>
					<tr class="tableTitle">
						<th>
							<h3>&nbsp;</h3>
						</th>
						<th>
							<h3>&nbsp;</h3>
						</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td width="200" align="right"><h4>订单号:&nbsp;&nbsp;</h4></td>
						<td>
							<input type="text" validation="required" name="order.order_id" id="orderId" value="${order.order_id}"/>
							<input type="hidden" name="order.id" id="id" value="${order.id}"/> 
							<em style="color:red;">*</em>
						</td>
					</tr> 
					<tr>
						<td width="200" align="right"><h4>客人名称:&nbsp;&nbsp;</h4></td>
						<td>
							<select  validation="required=1"  name="order.client_id" id="clientId" style="width: 128px">
									<option value="">请选择</option>
								<c:forEach items="${clientList}" var="data">
									<option value="${data.id }" <c:if test="${order.client_id == data.id}">selected</c:if>>${data.name }</option>
								</c:forEach>
							</select>
							<em style="color:red;">*</em>
						</td>
					</tr>
					<tr>
						<td align="right"><h4>下单日期:&nbsp;&nbsp;</h4></td>
						<td>
							<input type="text" validation="date,required" readonly="readonly" name="order.order_date" id="orderDate" value="${order.order_date}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',lang:'zh-cn'})" class="Wdate" style="width:126px"/>
							<em style="color:red;">*</em>
						</td>
					</tr> 
					<tr>
						<td align="right"><h4>交货日期:&nbsp;&nbsp;</h4></td>
						<td>
							<input type="text" validation="date,required" readonly="readonly" name="order.delivery_date" id="deliveryDate" value="${order.delivery_date}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',lang:'zh-cn'})" class="Wdate" style="width:126px"">
							<em style="color:red;">*</em>
						</td>
					</tr> 
					<tr>
						<td align="right"><h4>备注:&nbsp;&nbsp;</h4></td>
						<td><textarea cols="40" rows="5" name="order.comments" id="comments">${order.comments}</textarea></td>
					</tr> 
				</tbody>
				<tfoot>
					<tr  class="tableController_bottom">
						<td align="center">
							&nbsp;
						</td>
						<td align="left">
							<a class="button" href="javascript:void(0)" onclick="this.blur(); save();'return false';"><span><img src="${pageContext.request.contextPath }/js/kui/icons/disk.png" align="absmiddle"/>&nbsp;保存</span></a>
							<a class="button" href="javascript:void(0)" onclick="this.blur(); history.go(-1);'return false';"><span><img src="${pageContext.request.contextPath }/js/kui/icons/anticlockwise.png" align="absmiddle"/>&nbsp;返回</span></a>
						</td>
					</tr>
				</tfoot>
		</table>
		</form>
		<script type="text/javascript">
		
			var formId = 'myForm';
			var valid = new KUI.Validation({formId: formId, immediate: true});
			function save(){
				if(valid.validate()){
					document.getElementById(formId).submit();
				}
			}
		</script>
  </body>
</html>
